package com.myspring.springaop.advice;


import com.myspring.springaop.MethodInvocation;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * 自定义方法拦截器接口
 * 环绕通知
 * @author zhang
 */
public interface MethodInterceptor extends Advice {

    /**
     * CGLIB
     */
    Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable;

    /**
     * Spring AOP 拦截方法调用
     */
    Object invoke(MethodInvocation invocation) throws Throwable;
}